import 'package:flutter/material.dart';
import 'package:kq_flutter_core_widget/utils/kq_screen_util.dart';

import '../../config/kq_global.dart';
import '../../resources/images.dart';

/// 印章控件
class KqPrintImage extends StatelessWidget {
  /// 印章类型，使用[KqPrintType]
  final KqPrintType printType;

  const KqPrintImage({Key? key, required this.printType}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    String img = Images.commonIcHege44;
    if (printType == KqPrintType.qualified) {
      img = Images.commonIcHege44;
    } else if (printType == KqPrintType.giveStep) {
      img = Images.commonIcRangbu44;
    } else if (printType == KqPrintType.unqualified) {
      img = Images.commonIcBuhege44;
    } else if (printType == KqPrintType.waste) {
      img = Images.commonIcZuofei44;
    } else if (printType == KqPrintType.withdraw) {
      img = Images.commonIcChexiao44;
    } else if (printType == KqPrintType.hasRemake) {
      img = Images.commonIcYifanxiu44;
    }
    return Image.asset(img,
        width: 44.r,
        height: 44.r,
        fit: BoxFit.fill,
        package: KqGlobal.packageName);
  }
}

enum KqPrintType {
  /// 合格
  qualified,

  /// 让步
  giveStep,

  /// 不合格
  unqualified,

  /// 作废
  waste,

  /// 撤销,退回
  withdraw,

  /// 已返修
  hasRemake,
}
